
#ifndef DIALOGLISTITEM_H
#define DIALOGLISTITEM_H

#include <BRect>
#include <BIcon>
#include <BFont>

using namespace BWE;

class DialogListWidget;

class DialogListItem : public BObject
{
	friend class DialogListWidget;
public:
	DialogListItem();
	~DialogListItem();

	DialogListWidget* listWidget();

	void setIcon(BIcon* icon);
	BIcon* icon() const;

	void setText(const BString& text);
	const BString& text() const;

	void setAlign(Align align);
	Align align() const;

	void setForm(Form form);
	Form form() const;

	void setRect(const BRect& rect);
	const BRect& rect() const;

protected:
	void freshSize(const BFont* font);
	void adjustRect(int x, int y, int width, int height);

private:
	DialogListWidget*	_listWidget;
	BIconHolder			_icon;
	BString				_text;
	Align				_align;
	Form				_form;

	bool				_dirty;
	int					_index;
	BSize				_textSize;
	BSize				_imageSize;
	BSize				_hintSize;
	BRect				_imageArea;
	BRect				_textRect;
	BRect				_textArea;
	BRect				_imageRect;
	BRect				_rect;
	bool				_selected;
	bool				_visible;
};

#endif
